﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mfReleaseForum.aspx.cs" Inherits="msBsc.WebUi.mMall.Seller.mfReleasePost" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
    <title>地接客-旅游推荐</title>
    <%=getMeta()%>
    <link href="/themes/mStyle1/css/home/base.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/themes/mStyle1/mGlobal.css" charset="gbk" />
    <link href="/jqPlugin/kindeditor/themes/default/default.css" type="text/css" rel="stylesheet" />
    <%=getBodyBeforeJs()%>
    <style type="text/css">
        img {
            border: 0 none;
        }

        .b_price {
            color: red;
            font-size: 15px;
            font-weight: bold;
        }

        .listcon dl dd p .span_l {
            margin-right: 5px;
            text-align: left;
        }

        .listcon dl dd p span {
            display: block;
            float: left;
        }

        .span_r {
            float: right;
            margin-right: 5px;
            border-radius: 7px;
            display: inline-block;
            font-size: 15px;
            min-width: 50px;
            text-align: center;
        }

        body {
            margin: 0;
            padding: 0;
            background-color: #ffffff;
        }

        .viewport {
            background-color: #edeeee;
        }



        .fabu {
            width: 95%;
            margin: 15px auto;
        }

        .pageInfo {
            font-size: 18px;
            height: 20px;
            padding-left: 10px;
        }


        .input_txt {
            width: 100%;
            height: 50px;
            border-radius: 3px;
            border: 1px solid #c3c3c3;
            margin: 5px auto;
            font-size: 14px;
        }

        .input_textarea {
            width: 100%;
            min-height: 160px;
            border-radius: 3px;
            border: 1px solid #c3c3c3;
            margin: 5px auto;
            font-size: 14px;
        }

        .addImage {
            background: url("/themes/mStyle1/Image/public/addimg.gif") no-repeat scroll left #c3c3c3;
            color: #c3c3c3;
            border: medium none;
            border-radius: 7px;
            color: #fff;
            cursor: pointer;
            display: inline-block;
            font-size: 16px;
            font-weight: bold;
            height: 35px;
            line-height: 31px;
            min-width: 133px;
            padding: 0 20px;
            text-align: right;
            float: left;
        }

        .green {
            background: none repeat scroll 0 0 #69cd38;
            border: medium none;
            border-radius: 7px;
            color: #fff;
            cursor: pointer;
            display: inline-block;
            font-size: 16px;
            font-weight: bold;
            height: 36px;
            line-height: 31px;
            padding: 0 20px;
            text-align: center;
            min-width: 135px;
            float: right;
            
        }

        .content {
            outline: none;
            background-color: #ffffff;
        }
        .content img {
            max-width:300px;
        }
        
    </style>
</head>
<body style="margin: 0; padding: 0;">
    <div class="viewport">
        <%=msBsc.WebUi.Code.QtHtmlGet.GetWapHeaderMenuHtml(true) %>
        <div class="main">
            <div>
                <input class="input_txt" id="title" type="text" placeholder="标题" />
            </div>
            <div>

                <div class="content input_textarea" id="forumInfo" contenteditable="true"></div>
                <div style="height: 100px;">
                    <%--<span onclick="shoFileView();" class="addImage">添加图片</span>--%>
                    <span onclick="ReleaseForum();" class="green">发布信息</span>
                </div>

                <%--<input id="btnupImg" type="file"  style="display: none;" />--%>
            </div>
        </div>
        <%=msBsc.WebUi.Code.QtHtmlGet.GetWapMenuHtml() %>
    </div>

    <!--start JS引用-->
    <script src="/jqPlugin/js/jquery-1.8.3.min.js"></script>
    <script src="/jqPlugin/js/jBase.js"></script>
    <script src="/jqPlugin/js/jBPage.js"></script>
    <script src="/jqPlugin/js/laytpl.js"></script>
    <script src='/??jqPlugin/kindeditor/kindeditor.js,jqPlugin/kindeditor/lang/zh_CN.js,jqPlugin/zxxFile/zxxFile.js'type='text/javascript'></script>
    <script type="text/javascript" src="/jqPlugin/js/jBase.js"></script>
    <script src="/themes/wStyle1/js/comm/VerifyJs.js"></script>
    <!--end JS引用-->
    <script type="text/javascript">
        var params = {
            fileInput: $("#btnupImg").get(0),
            filter: function (files) {
                var arrFiles = [];
                for (var i = 0, file; file = files[i]; i++) {
                    if (file.type.indexOf("image") == 0) {
                        if (file.size >= 2048000) {
                            alert('您这张"' + file.name + '"图片大小过大，应小于2M');
                        } else {
                            arrFiles.push(file);
                        }
                    } else {
                        alert('文件"' + file.name + '"不是图片。');
                    }
                }
                return arrFiles;
            },
            onSelect: function (files) {
                var html = '', i = 0;
                var funAppendImage = function () {
                    file = files[i];
                    if (file) {
                        var reader = new FileReader()
                        reader.onload = function (e) {
                            //图片上传
                            html = '<img  src="' + e.target.result + '" class="forum_image" />';
                            i++;
                            funAppendImage();
                        }
                        reader.readAsDataURL(file);
                    } else {
                        $("#forumInfo").append(html);
                        html = "";
                        //if (html) {
                        //    //删除方法
                        //    $(".upload_delete").click(function() {
                        //        ZXXFILE.funDeleteFile(files[parseInt($(this).attr("data-index"))]);
                        //        return false;	
                        //    });
                        //    //提交按钮显示
                        //    $("#fileSubmit").show();
                        //} else {
                        //    //提交按钮隐藏
                        //    $("#fileSubmit").hide();
                        //}
                    }
                };
                funAppendImage();
            },
            onDelete: function (file) {
                $("#uploadList_" + file.index).fadeOut();
            },
        };
        ZXXFILE = $.extend(ZXXFILE, params);
        ZXXFILE.init();


        function forumImg(imgurl) {
            _jsParam.AddCell("base64url", imgurl);
            _jsParam.AddCell("ACTION", "uploadbas64");
            ajaxComm(_jsParam);
        }
    </script>
    <script type="text/javascript">
        $(window).load(function () {
            $("#h_title").text("地接客-发布推荐");
            $.getMessageCount();
            setTimeout(function () {
                $(".ke-upload-file").hide();
                $(".ke-button-common").hide();

            }, 500);

        });

        function shoFileView() {
            $("#btnupImg").trigger("click");
        }

        function ReleaseForum() {
            var _jsParam = new jsonRow();
            //论坛标题
            var forumTitle = $("#title").val();
            if (!vfcTitleName(forumTitle)) {
                return;
            }
            //论坛内容
            //var forumInfo = $("#forumInfo").val();
            var forumInfo = $("#forumInfo").html();
            if (!vfcForumInfo(forumInfo)) {
                return;
            }
            _jsParam.AddCell("forumTitle", forumTitle);
            _jsParam.AddCell("forumInfo", forumInfo);
            _jsParam.AddCell("ACTION", "published");
            ajaxComm(_jsParam);
        };

        /*
     * 验证论坛标题
     * titleName 论坛标题
    */
        function vfcTitleName(titleName) {
            if (IsNull(titleName)) {
                alert("论坛标题不能为空");
                return false;
            }
            if (!islength(titleName, 0, 50)) {
                alert("论坛标题最大长度为40个字符");
                return false;
            }
            return true;
        }

        /*
         * 验证论坛内容
         * forumInfo 论坛内容
        */
        function vfcForumInfo(forumInfo) {
            if (IsNull(forumInfo)) {
                alert("*论坛内容不能为空");
                return false;
            }
            return true;
        }
    </script>
</body>
</html>
